Page({
    data: {
        inputShowed: false,
        radioItems: [
            { name: 'cell standard', value: '0' },
            { name: 'cell standard', value: '1', checked: true }
        ],
        inputVal: ""
    },
    showInput: function() {
        this.setData({
            inputShowed: true
        });
    },
    hideInput: function() {
        this.setData({
            inputVal: "",
            inputShowed: false
        });
    },
    clearInput: function() {
        this.setData({
            inputVal: ""
        });
    },
    radioChange: function(e) {
        var radioItems = this.data.radioItems;
        for (var i = 0, len = radioItems.length; i < len; ++i) {
            radioItems[i].checked = radioItems[i].value == e.detail.value;
        }

        this.setData({
            radioItems: radioItems
        });
    },
    inputTyping: function(e) {
        this.setData({
            inputVal: e.detail.value
        });
    }
});